<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/2/21
 * Time: 10:51
 */

namespace app\admin\validate;


use think\Validate;

class BaseValidate extends Validate
{
    // 自定义验证规则
    public function checkName($value,$rule,$data){
        if(is_mobile_phone($value)){
            return true;
        }else{
            return '手机号码格式不正确';
        }
    }
    /**
     * 验证是否是整型
     * @param $value
     * @return bool
     */
    protected function IDMustBeInt($value){
        if(is_numeric($value) && is_int($value + 0) && ($value + 0)>0 ){
            return true;
        }else{
            return false;
        }
    }
}